package com.meshnetics.gb.stack.core.apl.type;

import com.meshnetics.gb.type.impl.zcl.FixedBytesDataValue;
import com.meshnetics.gb.type.impl.zcl.FixedBytesDataType;

/**
 * Type for ClusterId.
 *
 * @author mmarkov
 */
public class TypeClusterId extends FixedBytesDataType {
    /** The only instance of this type. */
    public static final TypeClusterId TYPE = new TypeClusterId();

    /**
     * Constructs TypeClusterId with the given aliases.
     *
     * @param aliases aliases for TypeClusterId
     */
    protected TypeClusterId(String[] aliases) {
        super(aliases, 2);
    }

    /**
     * Contructs TypeClusterId with the pre-defined name ('clusterId').
     */
    private TypeClusterId() {
        super(new String[] { "clusterId" }, 2);
    }

    /**
     * Creates ClusterId from array of bytes.
     *
     * @param bytes array of bytes
     * @return constructed ClusterId
     */
    protected FixedBytesDataValue createValue(byte[] bytes) {
        return new ClusterId(this, bytes);
    }
}
